/*
 * Communication.h
 *
 *  Created on: 23.05.2011
 *      Author: aaw713
 */

#ifndef COMMUNICATION_H_
#define COMMUNICATION_H_

#include <iostream.h>
#include <termios.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <signal.h>
#include <sys/types.h>

#include "HAWThread.h"
#include "HAL.h"

#define BUFFERSIZE 4

extern int fd;
extern int * bandzustand_global;

class Communication : public thread::HAWThread{
public:
	Communication();
	virtual ~Communication();

	void init(int portnum);
	int receive(void* data, int len);
	int send(int buf, int len);

    HAL * hal;

protected:
    void execute(void* arg);
    void shutdown();
};

#endif /* COMMUNICATION_H_ */
